struct User {
    var imageFileId1: Int?
    var imageFileId2: Int?

}

let users = [
    User(imageFileId1: 100, imageFileId2: 200),
    User(imageFileId1: 101, imageFileId2: 201)
]

// 使用 flatMap 来展开并收集所有的 fileIds 到一个数组里
let fileIdArray = users.flatMap { [$0.imageFileId1, $0.imageFileId2].compactMap({$0}) }
print(fileIdArray) // 输出：[100, 200, 101, 201]